import 'package:flutter/material.dart';
import 'package:yp/config/style.dart';

/// 活动说明
class ActivityDeclaration extends StatefulWidget {
  const ActivityDeclaration({Key key}) : super(key: key);

  @override
  _ActivityDeclarationState createState() => _ActivityDeclarationState();
}

class _ActivityDeclarationState extends State<ActivityDeclaration>
    with SingleTickerProviderStateMixin {
  AnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(vsync: this);
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SingleChildScrollView(
      child: Column(
        children: [
          _item('活动奖品', '100积分'),
          _item('活动时间', '2019年9月30日 14:32至2019年10月07日 14:32'),
          _item('活动规则',
              '每人最多获取3个抽奖码 每人每天最多获取1个抽奖码 免费抽奖码：每人3次 助力获取抽奖码：好友每助力1次，获得1个抽奖码 一个用户最多可以助力3次'),
          _item('中奖通知', '短信通知'),
          _item('开奖时间', '2019年10月08日 10:00开奖')
        ],
      ),
    );
  }

  Widget _item(String title, String content) {
    return Padding(
      padding: const EdgeInsets.fromLTRB(12, 20, 12, 0),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.start,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            children: [
              Container(
                width: 4,
                height: 14,
                color: Color(0xff9f041b),
              ),
              SizedBox(width: 6),
              Text('奖品名称',
                  style: TextStyle(
                      color: EsColors.Title,
                      fontSize: EsSizes.MD,
                      fontWeight: EsFontWeights.Medium))
            ],
          ),
          SizedBox(height: 8),
          Padding(
            padding: const EdgeInsets.only(left: 10),
            child: Text(content,
                style: TextStyle(
                    color: EsColors.Content,
                    fontSize: EsSizes.XS,
                    fontWeight: EsFontWeights.Normal)),
          )
        ],
      ),
    );
  }
}
